<include file="public/layout"/>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>

<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>交易设置</h3>
                <h5>交易基本设置</h5>
            </div>
            <ul class="tab-base nc-row">
                <foreach name="group_list" item="v" key="k">
                    <li><a href="{:U('World.World/system',['inc_type'=> $k])}" <if condition="$k==$inc_type">class="current"</if>><span>{$v}</span></a></li>
                </foreach>
            </ul>
        </div>
    </div>
    <!-- 操作说明 -->
    <div class="explanation" id="explanation">
        <div class="title" id="checkZoom"><i class="fa fa-lightbulb-o"></i>
            <h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
            <span id="explanationZoom" title="收起提示"></span></div>
        <ul>
            <li>切不可频繁更改</li>
        </ul>
    </div>
    <form method="post" enctype="multipart/form-data" name="form1" action="{:U('World.World/handle')}">
        <input type="hidden" name="inc_type" value="{$inc_type}">
        <div class="ncap-form-default">

            <!--<dl class="row">-->
                <!--<dt class="tit">是否开启挂卖</dt>-->
                <!--<dd class="opt">-->
                    <!--<div class="onoff">-->
                        <!--<label for="switch1" class="cb-enable  <if condition="$config['sell_switch'] eq 1">selected</if>">开启</label>-->
                        <!--<label for="switch0" class="cb-disable <if condition="$config['sell_switch'] eq 0">selected</if>">关闭</label>-->
                        <!--<input type="radio"  id="switch1"  name="sell_switch" value="1" <if condition="$config['sell_switch'] eq 1">checked="checked"</if>>-->
                        <!--<input type="radio"  id="switch0"  name="sell_switch" value="0" <if condition="$config['sell_switch'] eq 0">checked="checked"</if> >-->
                    <!--</div>-->
                    <!--<p class="notic">注意：开关，切勿频繁修改分佣参数，容易引起系统运算报错</p>-->
                <!--</dd>-->
            <!--</dl>-->
            <dl class="row">
                <dt class="tit">
                    <label for="dc_cny_rate">一级矿工交易时间：</label>
                </dt>
                <dd class="opt">
                    <input style="width:65px!important"   name="entrance_2[start]" value="{$config.entrance_2.start|default=0}" class="input-txt" type="time">-
                    <input style="width:65px!important"   name="entrance_2[finish]" value="{$config.entrance_2.finish|default=0}" class="input-txt" type="time">

                    <p class="notic"></p>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <label for="dc_cny_rate">二级矿工交易时间：</label>
                </dt>
                <dd class="opt">
                    <input style="width:65px!important"   name="entrance_3[start]" value="{$config.entrance_3.start|default=0}" class="input-txt" type="time">-
                    <input style="width:65px!important"   name="entrance_3[finish]" value="{$config.entrance_3.finish|default=0}" class="input-txt" type="time">

                    <p class="notic"></p>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <label for="dc_cny_rate">三级矿工交易时间：</label>
                </dt>
                <dd class="opt">
                    <input style="width:65px!important"   name="entrance_4[start]" value="{$config.entrance_4.start|default=0}" class="input-txt" type="time">-
                    <input style="width:65px!important"   name="entrance_4[finish]" value="{$config.entrance_4.finish|default=0}" class="input-txt" type="time">

                    <p class="notic"></p>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <label for="dc_cny_rate">四级矿工交易时间：</label>
                </dt>
                <dd class="opt">
                    <input style="width:65px!important"   name="entrance_5[start]" value="{$config.entrance_5.start|default=0}" class="input-txt" type="time">-
                    <input style="width:65px!important"   name="entrance_5[finish]" value="{$config.entrance_5.finish|default=0}" class="input-txt" type="time">

                    <p class="notic"></p>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <label for="dc_cny_rate">ACC币-$汇率：</label>
                </dt>
                <dd class="opt">
                    1ACC币=
                    <input onKeyUp="this.value=this.value.replace(/[^\d.]/g,'')" onpaste="this.value=this.value.replace((/[^\d.]/g,'')" pattern="^\d{1,}$" id="dc_cny_rate" name="dc_cny_rate" value="{$config.dc_cny_rate|default=0}" class="input-txt" type="text">
                    $
                    <span class="err">只能输入整数</span>
                    <p class="notic"></p>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <label for="dc_cny_rate">$-CNY汇率：</label>
                </dt>
                <dd class="opt">
                    1$=
                    <input onKeyUp="this.value=this.value.replace(/[^\d.]/g,'')" onpaste="this.value=this.value.replace((/[^\d.]/g,'')" pattern="^\d{1,}$" id="prc_rate" name="prc_rate" value="{$config.prc_rate|default=0}" class="input-txt" type="text">
                    CNY
                    <span class="err">只能输入整数</span>
                    <p class="notic"></p>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <label for="dc_cny_rate">购买获取可售额度：</label>
                </dt>
                <dd class="opt">
                    1ACC币=
                    <input onKeyUp="this.value=this.value.replace(/[^\d.]/g,'')" onpaste="this.value=this.value.replace(/[^\d.]/g,'')" pattern="^\d{1,}$" id="available_credit" name="available_credit" value="{$config.available_credit|default=0}" class="input-txt" type="text">
                    可售额度
                    <span class="err">只能输入整数</span>
                    <p class="notic"></p>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <label for="balance_wallet">可售余额兑换矿池钱包：</label>
                </dt>
                <dd class="opt">
                    1可售余额=
                    <input onKeyUp="this.value=this.value.replace(/[^\d]/g,'')" onpaste="this.value=this.value.replace(/[^\d]/g,'')" pattern="^\d{1,}$" id="balance_wallet" name="balance_wallet" value="{$config.balance_wallet|default=0}" class="input-txt" type="text">
                    矿池钱包
                    <span class="err">只能输入整数</span>
                    <p class="notic"></p>
                </dd>
            </dl>

            <!--<dl class="row">-->
                <!--<dt class="tit">-->
                    <!--<label for="dc_transfer_rate">DC币转赠手续费：</label>-->
                <!--</dt>-->
                <!--<dd class="opt">-->
                    <!--<input onKeyUp="this.value=this.value.replace(/[^\d]/g,'')" onpaste="this.value=this.value.replace(/[^\d]/g,'')" pattern="^\d{1,}$" id="dc_transfer_rate" name="transfer_fee" value="{$config.transfer_fee|default=0}" class="input-txt" type="text">-->
                    <!--%-->
                    <!--<span class="err">只能输入整数</span>-->
                    <!--&lt;!&ndash;<p class="notic">单位:%</p>&ndash;&gt;-->
                <!--</dd>-->
            <!--</dl>-->

            <!--<dl class="row">-->
                <!--<dt class="tit">-->
                    <!--<label for="buy_price">ACC单价：</label>-->
                <!--</dt>-->
                <!--<dd class="opt">-->
                    <!--<input onKeyUp="this.value=this.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')" onpaste="this.value=this.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')" pattern="^\d{1,}$" id="buy_price" name="buy_price" value="{$config.buy_price|default=0}" class="input-txt" type="text">-->
                    <!--<span class="err">只能输入整数</span>-->
                    <!--<p class="notic">只能输入两位小数</p>-->
                <!--</dd>-->
            <!--</dl>-->



            <dl class="row">
                <dt class="tit">
                    <label for="price_float">币值价格浮动：</label>
                </dt>
                <dd class="opt">
                    <select name="ACC_float_type" id="ACC_float_type" style="height:26px">
                        <option value="0"<if condition="$config.ACC_float_type eq 0">selected</if>>等比</option>
                        <option value="1" <if condition="$config.ACC_float_type eq 1">selected</if>>等差</option>
                    </select>
                    <input onKeyUp="this.value=this.value.replace(/[^\d]/g,'')" onpaste="this.value=this.value.replace(/[^\d]/g,'')" pattern="^\d{1,}$" id="ACC_float" name="ACC_float" value="{$config.ACC_float|default=0}" class="input-txt" type="text">
                    %
                    <span class="err">只能输入正整数</span>
                    <p class="notic">只能输入正整数</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="price_float">挂卖价格：</label>
                </dt>
                <dd class="opt">
                    <input onKeyUp="this.value=this.value.replace(/[^\d]/g,'')" onpaste="this.value=this.value.replace(/[^\d]/g,'')" pattern="^\d{1,}$" id="hang_sell_price" name="hang_sell_price" value="{$config.hang_sell_price|default=0}" class="input-txt" type="text">
                    %
                    <span class="err">只能输入正整数</span>
                    <p class="notic">只能输入正整数</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="price_float">挂买价格：</label>
                </dt>
                <dd class="opt">
                    <input style="width:50px!important;" onKeyUp="this.value=this.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')" onpaste="this.value=this.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')" pattern="^\d{1,}$" id="hang_buy_price[start]" name="hang_buy_price[start]" value="{$config.hang_buy_price.start|default=0}" class="input-txt" type="text">-
                    <input style="width:50px!important;" onKeyUp="this.value=this.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')" onpaste="this.value=this.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')" pattern="^\d{1,}$" id="hang_buy_price[finish]" name="hang_buy_price[finish]" value="{$config.hang_buy_price.finish|default=0}" class="input-txt" type="text">

                    <span class="err"></span>
                    <p class="notic">只能输入两位小数</p>
                </dd>
            </dl>

            <dl class="row" id="element">
                <dt class="tit">
                    <label for="price_float">累计增送：</label>
                </dt>

                    <dd class="opt">
                        <empty name="$config.accumulative_give">
                            <div class="size">
                                累计<input style="width:50px!important;" onKeyUp="this.value=this.value.replace(/[^\d]/g,'')" onpaste="this.value=this.value.replace(/[^\d]/g,'')" pattern="^\d{1,}$" id="accumulative_give[0][num]" name="accumulative_give[0][num]" value="{$config.ACC_float|default=0}" class="input-txt" type="text">送
                                <select class="form-control" name="accumulative_give[0][miner]">
                                    <option value="0">选择矿机</option>
                                    <foreach name="mill_list" item="vo">
                                        <option value="{$vo.miner_id}">{$vo.miner_name}</option>
                                    </foreach>
                                </select>
                                <a onclick="add_buy_rights(this);" style="color: #0076ef; text-decoration: underline;">添加</a>
                            </div>
                        <else/>
                        <foreach name="$config.accumulative_give" item="v" key="k">
                            <div class="size">
                                累计<input style="width:50px!important;" onKeyUp="this.value=this.value.replace(/[^\d]/g,'')" onpaste="this.value=this.value.replace(/[^\d]/g,'')" pattern="^\d{1,}$" id="accumulative_give[{$k}][num]" name="accumulative_give[{$k}][num]" value="{$v.num|default=0}" class="input-txt" type="text">送
                                <select class="form-control" name="accumulative_give[{$k}][miner]">
                                    <option value="0">选择矿机</option>
                                    <foreach name="mill_list" item="vo">
                                        <if condition="$v.miner eq $vo.miner_id">
                                            <option value="{$vo.miner_id}" selected>{$vo.miner_name}</option>
                                            <else/>
                                            <option value="{$vo.miner_id}">{$vo.miner_name}</option>
                                        </if>

                                    </foreach>
                                </select>
                                <if condition="$k eq 0">
                                    <a onclick="add_buy_rights(this);" style="color: #0076ef; text-decoration: underline;">添加</a>
                                    <else />
                                    <a onclick="del_buy_rights(this);" style="color: red; text-decoration: underline;">删除</a>
                                </if>
                            </div>

                        </foreach>
                        </empty>
                    </dd>



            </dl>

            <dl class="row">
                <dt class="tit">
                    <label for="cancel_time">付款超时：</label>
                </dt>
                <dd class="opt">
                    <input onKeyUp="this.value=this.value.replace(/[^\d]/g,'')" onpaste="this.value=this.value.replace(/[^\d]/g,'')" pattern="^\d{1,}$" id="pay_over" name="pay_over" value="{$config.pay_over|default=0}" class="input-txt" type="text">分钟
                    <span class="err">只能输入整数</span>
                    <p class="notic">交易订单接单后多少分钟后未确认打款，订单取消</p>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <label for="cancel_time">收款超时：</label>
                </dt>
                <dd class="opt">
                    <input onKeyUp="this.value=this.value.replace(/[^\d]/g,'')" onpaste="this.value=this.value.replace(/[^\d]/g,'')" pattern="^\d{1,}$" id="receiving_over" name="receiving_over" value="{$config.receiving_over|default=0}" class="input-txt" type="text">分钟
                    <span class="err">只能输入整数</span>
                    <p class="notic">交易订单接单后多少分钟后未确认打款，订单取消</p>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <label for="cancel_time">挂卖手续费：</label>
                </dt>
                <dd class="opt">
                    <input onKeyUp="this.value=this.value.replace(/[^\d]/g,'')" onpaste="this.value=this.value.replace(/[^\d]/g,'')" pattern="^\d{1,}$" id="selling_commission" name="selling_commission" value="{$config.selling_commission|default=0}" class="input-txt" type="text">%
                    <span class="err">只能输入整数</span>

                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <label for="app_version">APP版本号</label>
                </dt>
                <dd class="opt">
                    <input id="app_version" name="app_version" value="{$config.app_version|default=0}" class="input-txt" type="text">
                    <p class="notic">用于显示在前端个人管理页面</p>
                </dd>
            </dl>


            <div class="bot"><a href="JavaScript:void(0);" class="ncap-btn-big ncap-btn-green" onclick="document.form1.submit()">确认提交</a></div>
        </div>
    </form>
</div>
<script type="text/javascript">

</script>
<div id="goTop">
    <a href="JavaScript:void(0);" id="btntop">
        <i class="fa fa-angle-up"></i>
    </a>
    <a href="JavaScript:void(0);" id="btnbottom">
        <i class="fa fa-angle-down"></i>
    </a>
</div>
</body>
<script>
    function add_buy_rights(that){
        var element = $('#element').find('.opt').find('.size');
        var size = element.size();

        var add_element = '   <div class="size">\n' +
            '累计<input style="width:50px!important;" onKeyUp="this.value=this.value.replace(/[^\\d]/g,\'\')" onpaste="this.value=this.value.replace(/[^\\d]/g,\'\')" pattern="^\\d{1,}$" id="accumulative_give['+ size +'][num]" name="accumulative_give['+ size +'][num]"  class="input-txt" type="text">送\n' +
            '<select class="form-control" name="accumulative_give['+ size +'][miner]">\n' +
            '<option value="0">选择矿机</option>\n' +
            '<foreach name="mill_list" item="vo">\n' +
            '<option value="{$vo.miner_id}">{$vo.miner_name}</option>\n' +
            '</foreach>\n' +
            '</select>\n' +
            '<a onclick="del_buy_rights(this);" style="color: red; text-decoration: underline;">删除</a>\n' +
            '\n' +
            '</div>';
        $('#element').find('.opt').append(add_element);
    }
    function del_buy_rights(that){
        $(that).parent().remove();
        var element = $('#element').find('.opt').find('.size');

        var i = 0;
        element.each(function(){
            $(this).find('input').attr('name','accumulative_give['+i+'][num]');
            $(this).find('select').attr('name','accumulative_give['+i+'][miner]');
            i++;

        });
    }
</script>
</html>